// Copyright 2022 Huawei Cloud Computing Technology Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef CLOUDAPPENGINE_CAEMSGCODE_H
#define CLOUDAPPENGINE_CAEMSGCODE_H

#include <string>
#include <map>

enum {
    CAE_CONNECTING = 0x0100,
    CAE_CONNECT_SUCCESS = 0x0200,
    CAE_SERVER_UNREACHABLE = 0x0301,
    CAE_RESOURCE_IN_USING = 0x0302,

    CAE_VERIFYING = 0x0400,
    CAE_VERIFY_SUCCESS = 0x0500,
    CAE_VERIFY_PARAMETER_MISSING = 0x0601,
    CAE_VERIFY_PARAMETER_INVALID = 0x0602,
    CAE_VERIFY_AES_KEY_QUERY_FAILED = 0x0603,
    CAE_VERIFY_AES_KEY_INVALID = 0x0604,
    CAE_VERIFY_DECRYPT_FAILED = 0x0605,
    CAE_VERIFY_FAILED = 0x0606,
    CAE_VERIFY_SESSION_ID_INVALID = 0x0607,

    CAE_START_SUCCESS = 0x0800,
    CAE_PARAMETER_MISSING = 0x0904,

    CAE_CONNECT_LOST = 0x0A00,
    CAE_RECONNECTING = 0x0B00,
    CAE_RECONNECT_SUCCESS = 0x0C00,
    CAE_RECONNECT_PARAMETER_INVALID = 0x0D01,
    CAE_RECONNECT_SERVER_UNREACHABLE = 0x0D02,
    CAE_RECONNECT_ENGINE_START_ERROR = 0x0D03,

    CAE_TRAIL_PLAY_TIMEOUT = 0x0E00,
    CAE_NOTOUCH_TIMEOUT = 0x0F00,
    CAE_HOME_TIMEOUT = 0x1000,

    CAE_DECODE_ERROR = 0x1100,
    CAE_ENGINE_START_FAILED = 0x1101,
    CAE_H265_NOT_SUPPORTED = 0x1102,

    CAE_SWITCH_BACKGROUND_SUCCESS = 0x1200,
    CAE_SWITCH_BACKGROUND_ERROR = 0x1301,
    CAE_SWITCH_FOREGROUND_SUCCESS = 0x1400,
    CAE_SWITCH_FOREGROUND_ERROR = 0x1501,

    CAE_ORIENTATION = 0x1600,

    CAE_SET_MEDIA_CONFIG_SUCCESS = 0x2100,
    CAE_SET_MEDIA_CONFIG_ERROR = 0x2201,

    CAE_ENABLE_VIRTUAL_DEV_SUCCESS = 0x2200,
    CAE_ENABLE_VIRTUAL_DEV_FAILED = 0x2201,

    CAE_INVALID_CMD = 0xFFFF,
};

class CaeMsgCode {
public:
    static bool GetMsg(const uint32_t code, std::string &msg);
};

#endif // CLOUDAPPENGINE_CAEMSGCODE_H
